home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-07 | 2.9 KB | 92 lines | [TEXT/CCL2] |
-
- (in-package "VOICE-TOOLKIT")
-
- (defun voice-type-p (item)
- (string-equal "voice" (string (class-name item))
- :start1 0 :start2 0 :end1 4 :end2 4))
-
- (defun voice-class-p (class)
- (cond ((null class) nil)
- ((equal (class-name class) 'standard-object) nil)
- ((voice-type-p class) t)
- (t (some #'voice-class-p (class-direct-superclasses class)))))
-
-
- (defun voice-item-p (item)
- "use this function to determine whether an item is of voice type"
- (voice-class-p (class-of item)))
-
-
- (defun make-voice-shell (args)
- (insert-as-action (voice-shell-fn (find-action args)) args))
-
- (defun find-action (args)
- (cond ((equal (first args)
- ':DIALOG-ITEM-ACTION)
- (second args))
- ((null args) nil)
- (t (find-action (rest args)))))
-
- (defun insert-as-action (action listing &optional here)
- (cond (here
- (cons action (rest listing)))
- ((null listing)
- (cons ':DIALOG-ITEM-ACTION
- (insert-as-action action nil t)))
- ((equal (first listing)
- ':DIALOG-ITEM-ACTION)
- (cons (first listing)
- (insert-as-action action
- (rest listing)
- t)))
- (t (cons (first listing)
- (insert-as-action action
- (rest listing))))))
-
- (defun voice-shell-fn (initfn)
- #'(lambda (x)
- (if initfn (funcall initfn x))
- (reset-voice)))
-
-
- (defun voice-mapvect (vector fn position stop)
- (cond ((equal position stop) nil)
- ((voice-item-p (aref vector position))
- (funcall fn (aref vector position))
- (voice-mapvect vector fn (+ 1 position) stop))
- (t (voice-mapvect vector fn (+ 1 position) stop))))
-
- (defun string-to-wordlist (string &optional chars)
- (cond ((null string)
- (if chars
- (list (coerce chars 'string))))
- ((stringp string)
- (string-to-wordlist (coerce string 'list)))
- ((member (first string) '(#\Space #\( #\) #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\0)
- :test #'eq)
- (if chars
- (cons (coerce chars 'string)
- (string-to-wordlist (rest string) nil))
- (string-to-wordlist (rest string) nil)))
- (t (string-to-wordlist (rest string)
- (append chars (list (first string)))))))
-
- (defun set-diff (set1 set2 &optional result)
- (cond ((null set1) result)
- ((member (first set1) set2 :test #'equal)
- (set-diff (rest set1) set2 result))
- (t (set-diff (rest set1) set2 (cons (first set1) result)))))
-
-
- (defun valid (ident)
- "checks whether a specified indication method is valid"
- (cond ((and (numberp ident)
- (<= ident *white-color*)
- (>= ident *black-color*))
- ident)
- ((equal (string-upcase (format nil "~a" ident)) "ITALIC")
- :ITALIC)
- ((equal (string-upcase (format nil "~a" ident)) "BOLD")
- :BOLD)
- (t nil)))
-